package com.fastCms.business.mall.pojo.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fastCms.business.frame.config.BigDecimalValueFilter;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 杭州人参大健康管理有限公司 版权所有 Copyright 2019<br>
 *
 * @Description: <br>
 * @Project: healthPro <br>
 * @CreateDate: Created in 2019年5月27日 下午2:54:06 <br>
 * @Author: < a href="jiahui.zhao@healthpro.vip">jiahui.zhao</ a>
 */
@ApiModel(value = "ProductPO对象", description = "商品对象")
@Data
public class ProductPO {

    @TableId(value = "id", type = IdType.UUID)
    @ApiModelProperty(value = "商品主键", example = "")
    private String id;

    @ApiModelProperty(value = "组织编号", example = "RSD")
    @NotBlank(message = "组织编号不能为空")
    private String organizeCode;

    @ApiModelProperty(value = "品牌id", example = "1")
    @NotBlank(message = "商品品牌不能为空")
    private String brandId;

    @ApiModelProperty(value = "品类Id", example = "1")
    @NotBlank(message = "商品品类不能为空")
    private String categoryId;

    @ApiModelProperty(value = "产品名称", example = "商品1")
    @NotBlank(message = "产品名称不能为空")
    private String productName;

    @ApiModelProperty(value = "子标题")
    private String subTitle;

    @ApiModelProperty(value = "产品类型（PHYSICAL_GOODS实物商品,VIRTUAL_GOODS虚拟商品）", example = "PHYSICAL_GOODS")
    @NotBlank(message = "产品类型不能为空")
    private String productType;

    @ApiModelProperty(value = "产品代码", example = "1")
    private String productCode;

//    @ApiModelProperty(value = "商品首图", example = "1")
//    private String mainImageUrl;

    @ApiModelProperty(value = "商品视频url")
    private String productVideo;

    @ApiModelProperty(value = "产品单价", example = "100.50")
    @NotNull(message = "产品单价不能为空")
    private BigDecimal unitPrice;

    @ApiModelProperty(value = "产品原价", example = "100")
    @JsonSerialize(using = BigDecimalValueFilter.class)
    private BigDecimal originalPrice;

    @ApiModelProperty(value = "成本价", example = "100")
    @JsonSerialize(using = BigDecimalValueFilter.class)
    private BigDecimal costPrice;

    @ApiModelProperty(value = "富文本id", example = "1")
    @NotBlank(message = "富文本id不能为空")
    private String explainId;

    @ApiModelProperty(value = "剩余总库存", example = "99999")
    @NotNull(message = "剩余总库存不能为空")
    @Min(value = 0)
    private Integer remainStock;

    @ApiModelProperty(value = "总库存", example = "99999")
    private Integer totalStock;

    @ApiModelProperty(value = "商城基础销量", example = "200")
    private Integer storeBaseSaleCount;

//    @ApiModelProperty(value = "是否支持退款:TRUE:支持;FALSE;默认值FALSE", example = "FALSE")
//    private String canRefund;
//
//    @ApiModelProperty(value = "退款模式(1.未消费随时可退 2.不可退 3.人工审核)", example = "2")
//    private Integer refundModel;
//
//    @ApiModelProperty(value = "退款规则，文本格式，默认为空", example = "")
//    private String refundInfo;

    @ApiModelProperty(value = "微商城产品状态(状态枚举） (1上架 2下架)", example = "1")
    @NotNull(message = "微商城产品状态不能为空")
    private Integer storeStatus;

    @ApiModelProperty(value = "是否支持普通会员卡折扣(1支持2.不支持）", example = "1")
    private Integer canMemberCard;

    @ApiModelProperty(value = "是否支持付费会员卡折扣(1支持2.不支持）", example = "1")
    private Integer canMemberDiscard;

    @ApiModelProperty(value = "上架时间", example = "2019-04-10 20:00:00")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date onSaleTime;

    @ApiModelProperty(value = "医院[1,2]")
    private List<Long> hospitalIds;

    @ApiModelProperty(value = "门店Id", example = "[1,2]")
    private List<String> storeIds;

    @ApiModelProperty(value = "快递是否包邮(1-包邮2-不包邮)")
    private Integer expressFree;

    @ApiModelProperty(value = "商品重量（kg）")
    private Double weight;

    @ApiModelProperty(value = "配送模式（1-自发 2-代发）")
    private Integer deliverMode;

    @ApiModelProperty(value = "备注", example = "")
    private String remark;

    @ApiModelProperty(value = "商品预售状态;1-开启2-关闭")
    private Integer bookingSaleStatus;

    @ApiModelProperty(value = "商品预售时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date bookingSaleTime;

    @ApiModelProperty(value = "预约时间模式:1-默认时间模式2-自定义时间模式")
    private Integer reserveTimeMode;

}
